Skip to content

Instantly share code, notes, and snippets.

@tjtanjin
tjtanjin / python_telegram_bot_guide.md
Last active May 11, 2024 22:52
A short guide for hosting telegram bot on Ubuntu!

How to host a telegram bot on Ubuntu (18.04/20.04)

Introduction

This short guide will walk you through hosting your very own telegram bot on Ubuntu (tested on Ubuntu 18.04 and 20.04)!

Prerequisites

This guide assumes knowledge of the following:

1) Provisioning a VPS
2) Familiarity with SSH
3) Familiarity with linux command line
@codecat
codecat / Webservices.md
Last active May 11, 2024 22:51
Trackmania Webservices

New documentation

Note: There is a newly maintained community documentation site for all of Trackmania's APIs!

Visit it at: https://webservices.openplanet.dev/

Authentication setup

This guide will explain how to authenticate with Nadeo's API. There are 2 methods of doing so, one is via a Ubisoft account, and one is via a dedicated server account. Note that the dedicated server account way is easier but imposes some limitations on what you can access with the API, but it could be enough.

Refer to my Nadeo Go package for a complete example.

@noelbundick
noelbundick / LICENSE
Last active May 11, 2024 22:47
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@xiCO2k
xiCO2k / AuthTest.php
Created October 14, 2022 12:41
Testing Socialite
<?php
it('redirects to the correct Google sign in url', function () {
$driver = Mockery::mock('Laravel\Socialite\Two\GoogleProvider');
$driver->shouldReceive('redirect')
->andReturn(new RedirectResponse('https://redirect.url'));
Socialite::shouldReceive('driver')->andReturn($driver);
$this->get(route('oauth.redirect', 'google'))
@doorgan
doorgan / operations_test.exs
Last active May 11, 2024 22:44
Testing module macros
defmodule OperationsTest do
use ExUnit.Case, async: true
def make_mod() do
String.to_atom("Elixir.Test#{System.unique_integer([:positive])}")
end
describe "operation/2" do
setup do
mod = make_mod()
@Lucrecious
Lucrecious / scale2x.gdshader
Created July 19, 2022 23:51
A Fast Rot-Sprite shader based on Scale3x
shader_type canvas_item;
const vec4 background = vec4(1., 1., 1., 0.);
float dist(vec4 c1, vec4 c2) {
return (c1 == c2) ? 0.0 : abs(c1.r - c2.r) + abs(c1.g - c2.g) + abs(c1.b - c2.b);
}
bool similar(vec4 c1, vec4 c2, vec4 input) {
return (c1 == c2 || (dist(c1, c2) <= dist(input, c2) && dist(c1, c2) <= dist(input, c1)));
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Francophonie\Eudic\Customer Info]
"SerialCode"="cracked by Archon"
"TimesLeft3"=dword:000c85e7
"regDate"="2024/1/1 00:00:00"
"LicenseCode"="cracked by Archon"
@dtr2300
dtr2300 / nvim-events.md
Last active May 11, 2024 22:34
Overview of Nvim Events

Nvim Events

Nvim recognizes the following events. Names are case-insensitive.

BufAdd
Just after creating a new buffer which is
added to the buffer list, or adding a buffer
@codequokka
codequokka / start-tmux-automatically-on-zsh.zsh
Last active May 11, 2024 22:32
Start tmux automatically on zsh
# Start the tmux session if not alraedy in the tmux session
if [[ ! -n $TMUX ]]; then
# Get the session IDs
session_ids="$(tmux list-sessions)"
# Create new session if no sessions exist
if [[ -z "$session_ids" ]]; then
tmux new-session
fi